home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0141_Racer Simulation.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  4.5 KB  |  243 lines

  1. {
  2. Err.. RACER programmed by Scott Tunstall 1994.
  3. (When I first got me PC at the age of 22)
  4.  
  5. Update in March 95 (Also by Scott Tunstall) - to piss off the
  6. B.Sc chaps. And what's more folks it's already on BBS's so
  7. ripping off me code will mean I sue you for (C).
  8.  
  9. Renamed to The Dave Norrie Driving Simulator just to piss the c**t
  10. right off!! :) sorry Dave mate but this is easily the best game
  11. you'll play on your PC cos :
  12.  
  13.        (A) I programmed it
  14.        (B) Your f***ing name is on it. :) :) :)
  15.  
  16. Even SHITTER than the lawnmower simulator.. it's me racing game
  17. which has absolutely NO collision detection whatever. I done this
  18. just for a laugh see?
  19.  
  20. And to practise assembler. Compared to me efforts now the assembler
  21. code in this really SUCKS!! (But why should I optimize a piece of
  22. shit like this? :) )
  23.  
  24. (And no commenting either.. tut tut)
  25.  
  26. Oh by the way Ronny seeing as you don't believe I wrote space lords
  27. I thought I'd update me copy just for you... EAT YOUR WORDS
  28. }
  29.  
  30. Program Norrie_Simulator;
  31.  
  32. Uses Crt;
  33.  
  34. Var CarX: byte;
  35.     CarY: byte;
  36.     OldCarX : byte;
  37.     OldCarY : byte;
  38.     Speed: byte;
  39.     CaveY: byte;
  40.     CaveHeight: byte;
  41.     Dead: boolean;
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. {
  49. OH NO! I AM SO EMBARASSED BY THIS CODE IT IS SHIT!!
  50. }
  51.  
  52.  
  53. Procedure ScrollLeft; Assembler;
  54. label outer,shift;
  55.  
  56. asm
  57.      push ds
  58.      mov ax,$b800               { Want me to explain this eh? }
  59.      mov ds,ax
  60.  
  61.      mov bx,0
  62.      mov dl,22
  63.  
  64. outer:
  65.       mov cx,38                 { Woulda been better with CL }
  66.       push bx                   { ain't altered it to show you
  67.                                   how shit it is - if you understand asm }
  68.  
  69. shift:
  70.       mov ax,[bx+2]
  71.       mov [bx],ax
  72.       add bx,2
  73.       loop shift                { Err... don't tell anyone I wrote this OK }
  74.  
  75.       pop bx
  76.       add bx,80
  77.  
  78.       dec dl
  79.       jne outer
  80.  
  81.       pop ds
  82. End;
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. Procedure WriteNewTrack;
  91. var y:byte;
  92. Begin
  93.      If CaveY <> 1 Then
  94.         Begin
  95.         TextBackground(Green);
  96.         For Y:=1 to CaveY do
  97.         Begin
  98.             GotoXY(39,Y);
  99.             Write(' ');
  100.         End;
  101.      End;
  102.  
  103.      gotoxy(39,CaveY);
  104.      TextColor(White);
  105.      Write('O');
  106.  
  107.      gotoxy(39,CaveY+CaveHeight);
  108.      Write('O');
  109.  
  110.      TextBackground(LightGray);
  111.      For Y:=CaveY + 1 to (CaveY + (CaveHeight-1)) do
  112.      begin
  113.           gotoXY(39,Y);
  114.           Write(' ');
  115.      End;
  116.  
  117.      TextBackground(Green);
  118.      For Y:= (CaveY + CaveHeight + 1) to 22 do
  119.      begin
  120.           gotoxy(39,Y);
  121.           write(' ');
  122.      end;
  123. end;
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. Procedure DrawScreen;
  131. Var Action:byte;
  132. Begin
  133.      GotoXY(OldCarX,OldCarY);
  134.      TextBackground(LightGray);
  135.      Write(' ');
  136.  
  137.      ScrollLeft;
  138.      WriteNewTrack;
  139.  
  140.  
  141.      Action:= Random(30);
  142.      Case Action Of
  143.           1: If CaveY > 1 Then Dec(CaveY);
  144.           2: If (CaveY + CaveHeight)< 22 Then Inc(CaveY);
  145.           3: If CaveHeight > 6 Then Dec(CaveHeight);
  146.           4: If (CaveY + CaveHeight)< 22 Then Inc(CaveHeight);
  147.      End;
  148.  
  149. End;
  150.  
  151.  
  152.  
  153.  
  154.  
  155. Procedure Setup;
  156. Var X:byte;
  157. Begin
  158.      TextMode(CO40);
  159.      CaveY:=5;
  160.      CaveHeight:=15;
  161.      CarX:=1;
  162.      CarY:=12;
  163.      OldCarX:=CarX;
  164.      OldCarY:=CarY;
  165.  
  166.      Speed:=100;
  167.  
  168. { I added this bit to piss Dave off }
  169.  
  170.      gotoxy(4,24);
  171.      textcolor(WHITE);
  172.      textbackground(black);
  173.      write('The Dave Norrie Driving Simulator');
  174.  
  175. { This bit was in the original }
  176.  
  177.      For X:=1 to 38 do
  178.          DrawScreen;
  179.  
  180.  
  181.  
  182. End;
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190. Procedure MovePlayer;
  191. Begin
  192.      TextColor(LightGray);
  193.      TextBackground(Blue);
  194.      GotoXY(CarX,CarY);
  195.      Write('>');
  196.  
  197.      OldCarX:=CarX;
  198.      OldCarY:=CarY;
  199.  
  200.      If KeyPressed Then
  201.         Begin
  202.         Case Upcase(Readkey) of
  203.              'Q': If CarY>1 Then Dec(CarY);
  204.              'A': If CarY<22 Then Inc(CarY);
  205.              'O': If CarX>1 Then
  206.                      Begin
  207.                      Speed:=Speed+5;
  208.                      Dec(CarX);
  209.                      End;
  210.              'P': If CarX<20 Then
  211.                      Begin
  212.                      Speed:=Speed-5;
  213.                      Inc(CarX);
  214.                      End;
  215.         End;
  216.      End;
  217. End;
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225. Begin
  226. SetUp;
  227. Repeat
  228.      Delay(Speed);
  229.      DrawScreen;
  230.      MovePlayer;
  231. Until Dead;
  232. End.
  233.  
  234.  
  235.  
  236. {    Here's a few possible additions for you sad fucks who
  237.      actually like this trash:
  238.  
  239.      1. Collision detection (Not too good though - ruins the fun!)
  240.      2. Graphics ! (No then again maybe not)
  241.      3. Some sound (Keep it crap)
  242.      4. Err.. playability?
  243. }